<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<div id="vue">
    <p>调用当前时间的方法：{{currentTime()}}</p>
    <p>当前时间的计算属性：{{currentTime2}}</p>
</div>

<script type="text/javascript">
    var vm = new Vue({
        el: '#vue',
        data: {
            message: 'Hello Vue!'
        },
        methods:{
            currentTime: function () {
                return Date.now();
            }
        },
        computed:{
            currentTime2:function () {
                this.message;
                return Date.now();
            }
        }
    });
</script>
</body>
</html>